<?php
declare (strict_types = 1);

namespace app\api\controller;
use app\api\model\Store as StoreModel;


class Store
{
    //门店商品展示
    public function StoreGoodsList(){
        //分页查询
        $page=input('get.page');
        if(empty($page)){
            return json(['code'=>10401,'msg'=>'页码数不能为空','page'=>null]);
        }
        //每页展示调试
        $limit=input('get.limit');

        if(empty($limit)){
            return json(['code'=>10402,'msg'=>'每页展示数量不能为空','limit'=>null]);
        }
        //获取数据
        $arr=StoreModel::limit($page,$limit)->select();

        //返回
        if(empty($arr)){
            return json(['code'=>10403,'msg'=>'数据没有啦','limit'=>null]);
        }else{
            return json(['code'=>10200,'msg'=>'查询成功','data'=>$arr]);
        }
    }
}
